
function move(obj, json, options)
{
	options=options || {};
	var duration=options.duration || 1000;
	var easing=options.easing || 'linear';
	// start  dis n count
	var start={};
	var dis={};
	
	for (var name in json)
	{
		start[name]=parseFloat(getStyle(obj, name));
		dis[name]=json[name]-start[name];
	}
	
	var count=Math.floor(duration/30);
	var n=0;
	
	clearInterval(obj.timer);
	obj.timer=setInterval(function (){
		n++;
		
		// 改样式 start+dis*n/count
		for (var name in json)
		{
			
			
			switch (easing)
			{
				case 'linear':
					var cur=start[name]+dis[name]*n/count;
					break;
					
				case 'ease-in':
					var a=n/count;
					var cur=start[name]+dis[name]*a*a*a;
					break;
					
				case 'ease-out':
					var a=1-n/count;
					var cur=start[name]+dis[name]*(1-a*a*a);
					break;
			}
			
			if (name == 'opacity')
			{
				obj.style[name]=cur;
			}
			else
			{
				obj.style[name]=cur+'px';
			}
		}
		
		if (n == count)
		{
			clearInterval(obj.timer);
			options.complete && options.complete();
		}
	}, 30);
}

function getStyle(obj, sName)
{
	return (obj.currentStyle || getComputedStyle(obj, false))[sName];
}









